package org.dtrd.modules.doctor.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.doctor.entity.bean.WalletHistoryDetail;


/**
 * <p>
 * 医生钱包历史数据
 * </p>
 *
 * @author QR
 * @since 2021-12-20
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_wallet_history")
public class DtrdEntRdWalletHistory {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 医生id
     */
    @TableField("wallet_history_doctor_id")
    private Integer walletHistoryDoctorId;

    /**
     * 增加金额
     */
    @TableField("wallet_history_add_wallet")
    private Integer walletHistoryAddWallet;

    /**
     * 减少金额
     */
    @TableField("wallet_history_reduce_wallet")
    private Integer walletHistoryReduceWallet;

    @TableField("wallet_history_operation_type")
    private Integer walletHistoryOperationType;

    @TableField("wallet_history_status")
    private Integer walletHistoryStatus;

    @TableField("wallet_history_remark")
    private String walletHistoryRemark;

    @TableField("create_time")
    private Date createTime;

    public DtrdEntRdWalletHistory init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntRdWalletHistory parseFromDto(WalletHistoryDetail dto) {
        dataId = dto.getDataId();
        walletHistoryDoctorId = dto.getWalletHistoryDoctorId();
        walletHistoryAddWallet = dto.getWalletHistoryAddWallet();
        walletHistoryReduceWallet = dto.getWalletHistoryReduceWallet();
        walletHistoryOperationType = dto.getWalletHistoryOperationType();
        walletHistoryStatus = dto.getWalletHistoryStatus();
        walletHistoryRemark = dto.getWalletHistoryRemark();
        return this;
    }


}
